package cn.wolfcode.controller;

import cn.wolfcode.service.ILearnHttpClientService;
import cn.wolfcode.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("0204learnhttpclient")
public class HttpClientController {
    @Autowired
    private ILearnHttpClientService learnHttpClientService;
    @GetMapping("/getContent")
    public Object getContent(String url) {
        String content = learnHttpClientService.getUrlContent(url);
        return JsonResult.success(content);
    }
}
